package orgamenu.ihm.table;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

import orgamenu.metier.Repas;

public class MenuCellRenderer extends JLabel implements TableCellRenderer {

	private int row;
	private int col;
	private boolean isSelected;
	private Object repas;

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int col) {
		
		//this.setPreferredSize(new Dimension(200, 300));
		this.setBorder(new MyBorder());
		this.setBackground(Color.GREEN);
		this.repas = (Repas) value;
		this.row = row;
		this.col = col;
		this.isSelected = isSelected;
		return this;
	}

	public MenuCellRenderer() {}

	/**
	 * @return the row
	 */
	public int getRow() {
		return row;
	}

	/**
	 * @param row the row to set
	 */
	public void setRow(int row) {
		this.row = row;
	}

	/**
	 * @return the col
	 */
	public int getCol() {
		return col;
	}

	/**
	 * @param col the col to set
	 */
	public void setCol(int col) {
		this.col = col;
	}

	/**
	 * @return the isSelected
	 */
	public boolean isSelected() {
		return isSelected;
	}

	/**
	 * @param isSelected the isSelected to set
	 */
	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}

	/**
	 * @return the repas
	 */
	public Object getRepas() {
		return repas;
	}

	/**
	 * @param repas the repas to set
	 */
	public void setRepas(Object repas) {
		this.repas = repas;
	}
	
	

}